/*
 * (C) Copyright 2012, by Tim Xie.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.superapk.diamond.sqllite;

import java.util.ArrayList;

/**
 * SQL执行对象
 * 
 * @author     Tim Xie [tim.xie2008@gmail.com]
 * @date       2013-3-17
 * 
 */

class ExecSQL {
	
	private String execSql;
	
	private ArrayList<Object> bindArgs = new ArrayList<Object>();

	String getExecSql() {
		return execSql;
	}

	void setExecSql(String execSql) {
		this.execSql = execSql;
	}

	Object[] getBindArgs() {
		Object[] result = null;
		if(bindArgs != null && bindArgs.size() > 0){
			result = bindArgs.toArray();
		}
		return result;
	}
	
	String[] getBindStringArgs() {
		String[] result = new String[1];
		if(bindArgs != null && bindArgs.size() > 0){
			int size = bindArgs.size();
			result = new String[size];
			for(int i = 0;i < size;i++){
				result[i] = bindArgs.get(i).toString();
			}
		}
		return result;
	}

	void addBindArgs(Object bindObj) {
		this.bindArgs.add(bindObj);
	}
	
}
